using System;
using System.Collections.ObjectModel;

namespace AntEater.ComponentModel.Validation
{
    /// <summary>
    /// Provides an interface for validating an element
    /// </summary>
    public interface IValidatable
    {
        /// <summary>
        /// Determines whether this instance is valid.
        /// </summary>
        /// <returns>
        /// 	<c>true</c> if this instance is valid; otherwise, <c>false</c>.
        /// </returns>
        bool IsValid {
            get;
        }

        /// <summary>
        /// Validates the specified recursive.
        /// </summary>
        /// <param name="recursive">if set to <c>true</c> [recursive].</param>
        /// <returns></returns>
        ReadOnlyCollection<ValidationResult> Validate(bool recursive);
    }
}
